|
|
Hello,
I have some difficulties to orient objects.
In helping me in, see the attached picture in 'povray.binaries.images'.
I have 12 hexagons (from 0 to B). I would like to draw a torus that
passes through the barycenters of two hexagons (the coordinates of
the barycenters are known).
In the image, i made it between hexagon '0' and hexagon '2'.
My calculations are :
- with barycenter of hexagone '0' : v0
- with barycenter of hexagone '2' : v2
- compute the normalized normal vector : vn=vnormalize(vcross(v0, v2));
- calc the lenght of v0 -> lv0
- convert rectangulars coordinates of vn -> azimuth and rise.
Now draw the torus :
torus {
lv0, 0.020
rotate (90-rise)*z
rotate -azimuth*y
pigment { color DarkTurquoise }
finish { ambient 0.40 diffuse 0.60 }
}
Work for this case, not with other pairs of hexagons.
It's not really a povray's question, probably more than mathematical :
Is my method of calculation is correct ?
How to properly orient my torus depending on the normal vector ?
Thanks
--
klp
Post a reply to this message
|
|